<?php
namespace data\service;

use app\api\utils\ArrayUtil;
use data\model\ImgCatModel;

class ImgCatService extends BaseService {

    private $imgCatModel = null;

    public function __construct() {
        parent::__construct();
        $this->imgCatModel = new ImgCatModel();
    }

    public function getImgCat( $page , $pageSize , $where , $order = "" , $fields = "*" ){

        $imgCats = $this->imgCatModel->pageQuery( $page , $pageSize , $where , $order ,$fields );
        $retData = [];
        if(!empty($imgCats['data'])){
            foreach($imgCats['data'] as $k => $v){
                $retData[$k] = [
                    'id' => $v['id'],
                    'name' => $v['name']
                ];
            }
            return $retData;
        }
        return [];
    }



}
